Method and apparatus for constructing building in virtual environment, device, and storage medium

ABSTRACT

This application includes a method and an apparatus for constructing a target object in a virtual environment of an application, a device, and a storage medium. A first picture of the virtual environment is displayed according to a first perspective corresponding to a first observation direction of a virtual movable object in the virtual environment. An object construction controller corresponding to the target object is displayed. A touch operation on the object construction controller is received. A target construction position of the target object is determined based on the touch operation, a target distance, and the first observation direction of the virtual movable object. A touch release operation corresponding to the touch operation is received. Further, the target object is constructed at the determined target construction position according to the touch release operation.

RELATED APPLICATION

This application is a continuation of International Application No.PCT/CN2020/072821, filed on Jan. 17, 2020, which claims priority toChinese Patent Application No. 201910093429.2, filed on Jan. 30, 2019and entitled “METHOD AND APPARATUS FOR CONSTRUCTING BUILDING IN VIRTUALENVIRONMENT, DEVICE, AND STORAGE MEDIUM.” The entire disclosures of theprior applications are hereby incorporated by reference in theirentirety.

FIELD OF THE TECHNOLOGY

Embodiments of this application relate to the field of human-computerinteraction, including a method and an apparatus for constructing abuilding in a virtual environment, a device, and a storage medium.

BACKGROUND OF THE DISCLOSURE

Devices such as a smartphone and a tablet computer are provided withmany virtual environment-based applications.

In the foregoing virtual environment-based applications, a user can usevirtual materials to build a wall, stairs, a house, and the like, butrelated construction can require at least the following three steps:

First, click a building button to open a menu of building materials.

Second, rotate a perspective to adjust a position where the building(constructed with a default building material) is placed.

Third, click a placing button to complete the construction.

If a non-default building material is used, a step of “selecting arequired building material” further needs to be added.

Because the construction includes many steps, during construction of abuilding in a virtual environment, the construction of the buildingcannot be completed quickly and efficiently, and the human-computerinteraction efficiency is low.

SUMMARY

Embodiments of this application provide a method and an apparatus forconstructing a building in a virtual environment, a device, and astorage medium, which can reduce building construction steps, therebyefficiently completing construction of a building and improving thehuman-computer interaction efficiency. The technical solutions caninclude the following aspects.

According to an aspect of this application, a method for constructing atarget object in a virtual environment of an application is provided. Inthe method, a first picture of the virtual environment is displayedaccording to a first perspective corresponding to a first observationdirection of a virtual movable object in the virtual environment. Anobject construction controller corresponding to the target object isdisplayed. A touch operation on the object construction controller isreceived. A target construction position of the target object isdetermined based on the touch operation, a target distance, and thefirst observation direction of the virtual movable object. A touchrelease operation corresponding to the touch operation is received.Further, the target object is constructed at the determined targetconstruction position according to the touch release operation.

According to another aspect of this application, an apparatus forconstructing a target object in a virtual environment of an applicationis provided. The apparatus includes processing circuitry. The processingcircuitry is configured to display a first picture of the virtualenvironment according to a first perspective corresponding to a firstobservation direction of a virtual movable object in the virtualenvironment, and display an object construction controller correspondingto the target object. The processing circuitry is configured to receivea touch operation on the object construction controller, and determine atarget construction position of the target object based on the touchoperation, a target distance, and the first observation direction of thevirtual movable object. The processing circuitry is configured toreceive a touch release operation corresponding to the touch operation.Further, the processing circuitry is configured to construct the targetobject at the determined target construction position according to thetouch release operation.

According to another aspect of this application, a terminal is provided,including a processor and a memory storing at least one instruction, atleast one program, a code set, or an instruction set, the at least oneinstruction, the at least one program, the code set, or the instructionset being loaded and executed by the processor to implement the methodfor constructing the target object in the virtual environment of theapplication according to the foregoing aspects of this application andany one of the optional embodiments.

According to another aspect of this application, a non-transitorycomputer-readable storage medium, storing instructions which whenexecuted by a processor cause the processor to perform a method forconstructing a target object in a virtual environment of an applicationis provided. In the method, a first picture of the virtual environmentis displayed according to a first perspective corresponding to a firstobservation direction of a virtual movable object in the virtualenvironment. An object construction controller corresponding to thetarget object is displayed. A touch operation on the object constructioncontroller is received. A target construction position of the targetobject is determined based on the touch operation, a target distance,and the first observation direction of the virtual movable object. Atouch release operation corresponding to the touch operation isreceived. Further, the target object is constructed at the determinedtarget construction position according to the touch release operation.

For example, the technical solutions provided in the embodiments of thisapplication can achieve at least the following beneficial effects:

displaying a first-perspective picture of an application, a buildingjoystick control corresponding to a target building being superimposedand displayed on the first-perspective picture; receiving a touchoperation triggered on the building joystick control; determining, basedon the touch operation, a position at a target distance in a firstobservation direction in which the first perspective is located as atarget construction position of the target building; receiving a touchrelease operation corresponding to the touch operation; and constructingthe target building at the target construction position according to thetouch release operation. In the foregoing target building constructionprocess, a user completes, through the building joystick controlcorresponding to the target building, one touch and release operation tocomplete the construction of the target building at an aim pointposition of the first perspective, thereby implementing the fast andefficient construction of the target building in the virtual environmentof the application; compared with conventional target buildingconstruction that requires three steps, the foregoing constructionprocess reduces two steps and improves the human-computer interactionefficiency.

BRIEF DESCRIPTION OF THE DRAWINGS

To describe technical solutions of embodiments of this application moreclearly, the following briefly introduces the accompanying drawingsrequired for describing the embodiments. The accompanying drawings inthe following description show merely some embodiments of thisapplication, and a person of ordinary skill in the art may still deriveother accompanying drawings according to the accompanying drawings.

FIG. 1 is a schematic diagram of a camera model according to anexemplary embodiment of this application.

FIG. 2 is a structural block diagram of a device according to anexemplary embodiment of this application.

FIG. 3 is a flowchart of a method for constructing a building in avirtual environment according to an exemplary embodiment of thisapplication.

FIG. 4 is a schematic diagram of a display interface of a buildingjoystick control displayed in a virtual environment picture according toan exemplary embodiment of this application.

FIG. 5 is a flowchart of a method for constructing a building in avirtual environment according to another exemplary embodiment of thisapplication.

FIG. 6 is a schematic diagram of a display interface for constructing abuilding in a virtual environment according to an exemplary embodimentof this application.

FIG. 7 is a flowchart of a method for constructing a building in avirtual environment according to another exemplary embodiment of thisapplication.

FIG. 8 is a schematic diagram of a display interface for constructing abuilding in a virtual environment according to another exemplaryembodiment of this application.

FIG. 9 is a flowchart of a method for constructing a building in avirtual environment according to another exemplary embodiment of thisapplication.

FIG. 10 is a schematic diagram of a display interface for constructing abuilding in a virtual environment according to another exemplaryembodiment of this application.

FIG. 11 is a flowchart of a method for constructing a building in avirtual environment according to another exemplary embodiment of thisapplication.

FIG. 12 is a schematic diagram of a display interface for constructing abuilding in a virtual environment according to another exemplaryembodiment of this application.

FIG. 13 is a flowchart of a method for constructing a building in avirtual environment according to another exemplary embodiment of thisapplication.

FIG. 14 is a schematic diagram of a display interface for constructing abuilding in a virtual environment according to another exemplaryembodiment of this application.

FIG. 15 is a flowchart of a method for constructing a building in avirtual environment according to another exemplary embodiment of thisapplication.

FIG. 16 is a block diagram of an apparatus for constructing a buildingin a virtual environment according to an exemplary embodiment of thisapplication.

FIG. 17 is a structural block diagram of a device according to anexemplary embodiment of this application.

DESCRIPTION OF EMBODIMENTS

To make objectives, technical solutions, and advantages of thisapplication clearer, implementations of this application are describedbelow in further detail with reference to the accompanying drawings.

First, the following explains several terms involved in the embodimentsof this application.

Virtual environment: a virtual environment displayed (or provided) by anapplication when run on a device, such as a terminal. The virtualenvironment may be a simulated environment of the real world, or may bea semi-simulated semi-fictional three-dimensional (3D) environment, ormay be an entirely fictional 3D environment. The virtual environment maybe any one of a two-dimensional virtual environment, a 2.5-dimensionalvirtual environment, and a 3D virtual environment. The followingembodiments are described by using an example in which the virtualenvironment is a 3D virtual environment, but this application is notlimited thereto.

Virtual object: a movable object in a virtual environment. The movableobject may be at least one of a virtual character, a virtual animal, anda cartoon character. Optionally, in a case that the virtual environmentis a 3D virtual environment, the virtual object is a 3D model createdbased on a skeletal animation technology. Each virtual object has ashape and size in the 3D virtual environment, and occupies some space inthe 3D virtual environment.

Building: a virtual building constructed in a virtual environment. Thevirtual building may be virtual stairs, a virtual wall, a virtual floor,a virtual roof, or the like. Optionally, when the virtual environment isa 3D virtual environment, the virtual building is a 3D model. Eachvirtual building has a shape and size in the 3D virtual environment, andoccupies some space in the 3D virtual environment.

A user can construct a candidate building in the virtual environment.The candidate building is a building that is pre-set in the applicationand that the user is allowed to build. A target building is a buildingthat the user selects to build from the candidate buildings. Optionally,in a case that the 3D virtual environment is an environment in which atleast two virtual objects fight against each other, the virtual buildingcan be used for blocking an attack of an enemy. For example, in a casethat the at least two virtual objects fight against each other, the usercan block an attack of an enemy by building a virtual wall in adirection facing the attack of the enemy. Optionally, the virtual objectcan move across an obstacle in a forward direction by using aconstructed virtual building. For example, in a case that a riverappears in the forward direction of the virtual object, the user assiststhe virtual object to move across the river by constructing virtualstairs over the river.

Perspective: an observation angle for observation from a first-personperspective or a third-person perspective of a virtual object in avirtual environment. Optionally, in the embodiments of this application,the perspective is an angle for observing the virtual object by using acamera model in the virtual environment. An observation direction is adirection pointed to by a lens of the camera model in the virtualenvironment.

Optionally, the camera model automatically follows the virtual object inthe virtual environment. That is, when a position of the virtual objectin the virtual environment changes, a position of the camera modelfollowing the virtual object in the virtual environment changessimultaneously, and the camera model is always within a preset distancerange from the virtual object in the virtual environment. Optionally, inthe automatic following process, relative positions of the camera modeland the virtual object remain unchanged.

Camera model: a 3D model located around a virtual object in a 3D virtualenvironment. When a first-person perspective is adopted, the cameramodel is located near the head of the virtual object or at the head ofthe virtual object. When a third-person perspective is adopted, thecamera model may be located behind the virtual object and bound to thevirtual object, or may be located at any position at a preset distancefrom the virtual object. The virtual object located in the 3D virtualenvironment may be observed from different angles through the cameramodel. Optionally, when the third-person perspective is a first-personover-shoulder perspective, the camera model is located behind thevirtual object, such as the head and the shoulders of the virtualcharacter. Optionally, in addition to the first-person perspective andthe third-person perspective, the perspective also includes otherperspectives, such as a top perspective. When the top perspective isused, the camera model may be located above the head of the virtualobject. The top perspective is a perspective for observing the virtualenvironment at an angle from the air. Optionally, the camera model isnot actually displayed in the 3D virtual environment. In other words,the camera model is not displayed in the 3D virtual environmentdisplayed in a user interface (UI).

Description is made by using an example in which the camera model islocated at any position at a preset distance from the virtual object.Optionally, one virtual object corresponds to one camera model, and thecamera model may rotate with the virtual object as a rotation center.For example, the camera model is rotated with any point of the virtualobject as the rotation center. During rotation, the camera model is notonly rotated, but also displaced. During rotation, a distance betweenthe camera model and the rotation center remains unchanged, for example,the camera model is rotated on a surface of a sphere with the rotationcenter as a sphere center. Any point of the virtual character may be thehead or the torso of the virtual object, or any point around the virtualobject. This is not limited in the embodiments of this application.Optionally, when the camera model observes the virtual object, a centerof the perspective of the camera model points to a direction from apoint on the spherical surface at which the camera model is located tothe sphere center.

Optionally, the camera model may alternatively observe the virtualobject at a preset angle in different directions of the virtual object.

For example, referring to FIG. 1, a point in a virtual object 11 isdetermined as a rotation center 12, and the camera model rotates aroundthe rotation center 12. Optionally, the camera model is configured withan initial position, and the initial position is an upper rear positionof the virtual object, such as a rear position of the body). Forexample, as shown in FIG. 1, the initial position is a position 13, andwhen the camera model rotates to a position 14 or a position 15, aperspective direction of the camera model changes as the camera modelrotates.

The device in this application may be a terminal such as a portablelaptop computer, a mobile phone, a tablet computer, an ebook reader, anelectronic game console, a Moving Picture Experts Group Audio Layer IV(MP4) player, or the like.

For a hardware structure, the terminal can include a force touch screen120, a memory 140, and processing circuitry such as a processor 160,referring to a structural block diagram of the terminal shown in FIG. 2.

The force touch screen 120 may be a capacitive touch screen or aresistive touch screen. The force touch screen 120 is used forimplementing interaction between the terminal and the user. In anembodiment of this application, the terminal obtains, by using the forcetouch screen 120, a related operation of building construction triggeredby the user, such as a touch operation, a release operationcorresponding to the touch operation, a drag operation, an unfoldingoperation, and a selection operation.

The memory 140 may include one or more computer-readable storage media,such as one or more non-transitory computer-readable storage mediums.The computer-readable storage medium can include at least one of arandom access memory (RAM), a read-only memory (ROM), or a flash memory(Flash). An operating system 12 and an application 14 can be installedin the memory 140.

The operating system 12 is basic software provided for the application14 to perform secure access to computer hardware. The operating systemmay be an Android system or an iOS system.

The application 14 is an application supporting a virtual environment,and the virtual environment includes a virtual object. Optionally, theapplication 14 supports an application of a 3D virtual environment. Theapplication 14 may be any one of a virtual reality application, a 3D mapprogram, a military simulation program, a third-person shooter (TPS)game, a first-person shooter (FPS) game, a multiplayer online battlearena (MOBA) game, and a multiplayer gunfight survival game. Optionally,the application 14 may be a standalone application, such as a standalone3D game program, or may be an online network application.

The processor 160 may include one or more processing cores, for example,a 4-core processor or an 8-core processor. The processor 160 isconfigured to execute different instructions corresponding to differentoperations according to the related operation of building constructionreceived on the force touch screen 120.

FIG. 3 is a flowchart of a method for constructing an object, such as abuilding, in a virtual environment according to an exemplary embodimentof this application. The method applied to the terminal shown in FIG. 2is used as an example for description. The method can include thefollowing steps.

In step 201, a first-perspective picture of an application is displayed.For example, a first picture of the virtual environment is displayedaccording to a first perspective corresponding to a first observationdirection of a virtual movable object in the virtual environment.

The first-perspective picture of the application is displayed on theterminal. The application may be at least one of a virtual realityapplication program, a 3D map application, a military simulationprogram, a TPS game, an FPS game, and a MOBA game.

The first-perspective picture is a picture of a virtual environmentobserved from a first perspective of a virtual object in the virtualenvironment. Optionally, the first perspective is a perspective ofobserving the virtual environment by using a first-person perspective ofa virtual character. Alternatively, the first perspective is aperspective of observing the virtual environment by using a third-personperspective of a virtual character.

A building joystick control corresponding to a target building isfurther superimposed and displayed on the first-perspective picture. Thebuilding joystick control is a joystick control used for constructingthe target building, and the building joystick control is also used forcontrolling rotation of a perspective of the virtual object in thevirtual environment, so as to determine a target construction positionof the target building. For example, an object construction controller,such as the building joystick control, corresponding to the targetobject is displayed.

For example, FIG. 4 shows a building joystick control 31. As shown inthe left figure, the building joystick control 31 includes an outercircle 32 and a button 33, and a graphic of a target building 34 isdisplayed on the button 33. The building joystick control 31 isdisplayed on a virtual picture of the application of the terminal. Whena user triggers a touch operation on the button 33 of the buildingjoystick control 31, the terminal constructs the target building 34 inthe virtual environment. The user can also drag the touch operation toadjust the target construction position of the target building. The usercan drag the button 33 in any direction in the outer circle 32 to adjustthe target construction position. As shown in the middle figure, theuser drags the button 33 downward in the outer circle 32. As shown inthe right figure, the user drags the button 33 to the lower left in theouter circle 32.

Optionally, the target building includes at least one of a virtual wall,a virtual roof, virtual stairs, and a virtual floor.

In step 202, a touch operation triggered on the building joystickcontrol is received. For example, a touch operation on the objectconstruction controller is received.

The terminal includes a touch screen, and the touch operation triggeredby the user is received in a screen area corresponding to the buildingjoystick control. The touch operation is used for determining the targetconstruction position of the target building. The touch operation is anoperation that the user touches the screen and holds.

In step 203: a position at a target distance in a first observationdirection in which a first perspective is located as a targetconstruction position of a target building is determined based on thetouch operation. For example, a target construction position of thetarget object is determined based on the touch operation, a targetdistance, and the first observation direction of the virtual movableobject.

Optionally, a target distance is set in the application, and the targetdistance indicates a distance between the target construction positionand the virtual object when the target building is constructed in thevirtual environment.

The first observation direction in which the first perspective islocated coincides with a direction in which an aim point position of thefirst perspective is located. The terminal determines, based on thetouch operation, a position at the target distance in the firstobservation direction in which the first perspective is located as thetarget construction position of the target building. That is, the targetconstruction position is in the direction in which the aim pointposition of the first perspective is located.

Optionally, the target distance is a distance between a position of thevirtual character determined by the terminal and the target constructionposition. The target construction position is an intersection of astraight line extending in the first observation direction and an objectin the virtual environment.

In step 204, a touch release operation corresponding to the touchoperation is received.

The touch release operation is a release operation that the user movesthe hand away from the screen after triggering the touch operation onthe touch screen. The touch release operation corresponding to the touchoperation is used for constructing the target building at the targetconstruction position.

In step 205, the target building is constructed at the targetconstruction position according to the touch release operation. Forexample, the target object is constructed at the determined targetconstruction position according to the touch release operation.

The terminal constructs the target building at the target constructionposition according to the touch release operation corresponding to thetouch operation. That is, after the user adjusts the target constructionposition and releases the hand, one target building is automaticallyconstructed on the target construction position.

Optionally, the terminal constructs the target building at the targetconstruction position according to the touch release operation inresponse to the fact that no object affecting the construction exists atthe target construction position.

In summary, this embodiment provides a method for constructing abuilding in a virtual environment. A first-perspective picture of anapplication is displayed, and a building joystick control correspondingto a target building is superimposed and displayed on thefirst-perspective picture. A touch operation triggered on the buildingjoystick control is received. A position at a target distance in a firstobservation direction in which a first perspective is located isdetermined, based on the touch operation, as a target constructionposition of the target building. A touch release operation correspondingto the touch operation is received. The target building is constructedat the target construction position according to the touch releaseoperation. In the foregoing target building construction process, a usercompletes, through the building joystick control corresponding to thetarget building, one touch and release operation to complete theconstruction of the target building at an aim point position of thefirst perspective, thereby implementing the fast and efficientconstruction of the target building in the virtual environment of theapplication; compared with conventional target building constructionthat requires three steps, the foregoing construction process reducestwo steps and improves the human-computer interaction efficiency.

In the building construction process, the terminal displays the targetbuilding in the virtual environment. A display manner of the targetbuilding includes a first display manner and a second display manner. Insome embodiments, after determining the target construction position ofthe target building, the terminal displays the target building in thefirst display manner, and after constructing the target building at thetarget construction position, the terminal displays the target buildingin the second display manner. For example, FIG. 5 is a flowchart of amethod for constructing an object, such as a building, in a virtualenvironment, where the terminal applies the two display manners. Themethod is applied to the terminal and includes the following steps.

In step 301, a first-perspective picture of an application is displayed.

The first-perspective picture is a picture or image of a virtualenvironment observed from a first perspective of a virtual object in thevirtual environment. Optionally, the first perspective is a perspectiveof observing the virtual environment from a first-person perspective ofthe virtual object in the virtual environment. Alternatively, the firstperspective is a perspective of observing the virtual environment from athird-person perspective of the virtual object in the virtualenvironment.

A building joystick control corresponding to a target building issuperimposed and displayed on the first-perspective picture.

In step 302, a touch operation triggered on a building joystick controlis received.

A touch screen is mounted on the terminal, and the terminal receives thetouch operation triggered in a screen area corresponding to the buildingjoystick control. The touch operation is a touch operation of touchingthe screen and holding.

In step 303, a position at a target distance in a first observationdirection in which a first perspective is located as a targetconstruction position of a target building is determined based on thetouch operation.

The touch operation indicates a construction start event of the targetbuilding. The terminal starts to construct the target building accordingto the touch operation. First, the terminal determines a position at atarget distance in a first observation direction in which the firstperspective is located as a target construction position of the targetbuilding.

The first observation direction in which the first perspective islocated is a direction that an aim point position of the firstperspective points to. The target distance indicates a spatial distancebetween the direction that the virtual object points to along the aimpoint position and the target construction position in the virtualenvironment.

In step 304, a virtual model of the target building is displayed in afirst display manner at the target construction position.

After determining the target construction position, the terminaldisplays the virtual model of the target building in the first displaymanner at the target construction position.

Optionally, the first display manner is a manner of displaying a sketchof the target building, where the sketch is a contour map of the targetbuilding. Alternatively, the first display manner is a manner ofdisplaying the target building translucently. Optionally, a space volumeof the sketch of the target building or the translucent target buildingshown in the virtual environment is the same as a space volume occupiedby a completed target building in the virtual environment. The sketch ofthe target building or the translucent target building displayed at thetarget construction position is equivalent to a construction plan of thetarget building, rather than the construction completed at the targetconstruction position in the virtual environment.

Optionally, the terminal displays the virtual model of the targetbuilding in the first display manner at the target construction positionin response to the fact that no object affecting the construction existsat the target construction position. That is, when determining that noobject affecting the construction exists at the target constructionposition, the terminal displays the virtual model of the target buildingin the first display manner at the target construction position. Forexample, the target building is a virtual floor. When the terminaldetermines that a stone is set at the target construction position inthe virtual environment, the terminal refuses to construct the virtualfloor at the target construction position and refuses to display thevirtual model of the target building. When the target constructionposition in the virtual environment is a smooth ground, the terminaldisplays the virtual model of the target building in the first displaymanner at the target construction position.

In step 305, a touch release operation corresponding to the touchoperation is received.

The touch release operation is an operation that the user touches andmoves the hand away from the screen, and corresponds to the touchoperation.

In step 306, the target building is constructed at the targetconstruction position according to the touch release operation.

The terminal constructs the target building at the target constructionposition according to the touch release operation.

In step 307, the virtual model of the target building is displayed in asecond display manner at the target construction position.

The terminal displays the virtual model of the target building in thesecond display manner at the target construction position.

The second display manner is a manner that the target building iscompletely displayed in the virtual environment. The target buildingdisplayed in the second display manner is equivalent to a building thatactually exists in the virtual environment. For example, the targetbuilding is virtual stairs. The virtual stairs are displayed in thesecond display manner at the target construction position, and thevirtual object can climb upward by using the stairs.

For example, referring to FIG. 6, a first-perspective picture 50 of anapplication is displayed on a terminal. A building joystick control 51is superimposed and displayed on the first-perspective picture 50, and atarget building is displayed on the building joystick control 51. Theterminal receives a touch operation triggered on the building joystickcontrol 51, and displays the target building in a first display manneron a first display interface. As shown in a sketch 52 of the targetbuilding in the figure, shown with dashed lines for example, a targetconstruction position of the sketch 52 of the target building is locatedat an aim point position 53 of a first perspective. The terminalreceives a touch release operation corresponding to the touch operation,and displays a completed target building 54 in a second display manneron the first display interface. The target construction position islocated at a target distance L in a first observation direction in whichthe first perspective is located.

In summary, this embodiment provides a method for constructing abuilding in a virtual environment. A first-perspective picture of anapplication is displayed, and a building joystick control correspondingto a target building is superimposed and displayed on thefirst-perspective picture. A touch operation triggered on the buildingjoystick control is received. A position at a target distance in a firstobservation direction in which a first perspective is located isdetermined, based on the touch operation, as a target constructionposition of the target building. A touch release operation correspondingto the touch operation is received. The target building is constructedat the target construction position according to the touch releaseoperation. In the foregoing target building construction process, a usercompletes, through the building joystick control corresponding to thetarget building, one touch and release operation to complete theconstruction of the target building at an aim point position of thefirst perspective, thereby implementing the fast and efficientconstruction of the target building in the virtual environment of theapplication; compared with related target building construction thatrequires three steps, the foregoing construction process reduces twosteps and improves the human-computer interaction efficiency.

In a process of constructing a building in a virtual environment, a usercan also adjust a target construction position through a buildingjoystick control. FIG. 7 is a flowchart of a method for constructing anobject, such as a building, in a virtual environment according to anexemplary embodiment of this application, to describe a method foradjusting the target construction position. The method is applied to aterminal and includes the following steps.

In step 401, a first-perspective picture of an application is displayed.

For an exemplary description, refer to step 301. Details are notdescribed herein again.

In step 402, a touch operation triggered on the building joystickcontrol is received.

For an exemplary description, refer to step 302. Details are notdescribed herein again.

In step 403, rotation is performed, by using a virtual object as arotation center, from a first observation direction to a secondobservation direction according to a drag distance in response to a dragof the touch operation.

A touch operation is triggered on a displayed building joystick control,and is dragged on the building joystick control; and an observationdirection in which a perspective of the virtual object is located isadjusted according to the drag of the touch operation.

The user drags a touch position on the building joystick control around360 degrees to rotate an observation direction in which the perspectiveof the virtual object in a horizontal direction and a vertical directionis located. The terminal obtains, according to a drag distance, arotation angle of the observation direction in which the perspective islocated. By using the first observation direction as a reference and thevirtual object as a rotation center, the terminal rotates by theobtained rotation angle of the observation direction towards the dragdirection, to obtain a second perspective.

For example, the rotation angle of the observation direction is inpositive correlation with the drag distance, that is, a greater dragdistance indicates a greater rotation angle of the observationdirection. For example, the positive correlation between the rotationangle of the observation direction and the drag distance mayalternatively be expressed by using a linear formula.

In step 404, a second-perspective picture of the application isdisplayed.

The second-perspective picture is a picture or image of a virtualenvironment observed from a second perspective of a virtual object inthe virtual environment. Optionally, the second perspective is aperspective of observing the virtual environment from a first-personperspective of the virtual object in the virtual environment.Alternatively, the second perspective is a perspective of observing thevirtual environment from a third-person perspective of the virtualobject in the virtual environment.

In step 405, a position at a target distance in the second observationdirection as the target construction position of the target building isdetermined.

Referring to step 303, for example, the method for determining thetarget construction position in the second-perspective picture is thesame as the method for determining the target construction position inthe first-perspective picture. Details are not described herein again.

In step 406, a virtual model of the target building is displayed in afirst display manner at the target construction position.

For an exemplary description, refer to step 304. Details are notdescribed herein again.

In step 407, a touch release operation corresponding to the touchoperation is received.

For an exemplary description, refer to step 305. Details are notdescribed herein again.

In step 408, the target building at the target construction position isconstructed according to the touch release operation.

For an exemplary description, refer to step 306. Details are notdescribed herein again.

In step 409, the virtual model of the target building is displayed in asecond display manner at the target construction position.

For an exemplary description, refer to step 307. Details are notdescribed herein again.

For example, referring to FIG. 8, the terminal displays afirst-perspective picture 63, and receives a touch operation on abuilding joystick control 61. A target building 62 is displayed in thefirst-perspective picture 63. When the touch operation is draggeddownward, a first observation direction is rotated to a secondobservation direction. The terminal displays a second-perspectivepicture 64, and the target building 62 is displayed in thesecond-perspective picture 64; and when the touch operation is furtherdragged to the lower left, the second observation direction is rotatedto a third observation direction. The terminal displays athird-perspective picture 65, and the target building 62 is displayed inthe third-perspective picture 65. Since the touch release operation isnot triggered in the picture shown in FIG. 8, the target buildings 62are all displayed in the first display manner.

In summary, this embodiment provides a method for constructing abuilding in a virtual environment. A first-perspective picture of anapplication is displayed, and a building joystick control correspondingto a target building is superimposed and displayed on thefirst-perspective picture. A touch operation triggered on the buildingjoystick control is received. A position at a target distance in a firstobservation direction in which a first perspective is located isdetermined, based on the touch operation, as a target constructionposition of the target building. A touch release operation correspondingto the touch operation is received. The target building is constructedat the target construction position according to the touch releaseoperation. In the foregoing target building construction process, a usercompletes, through the building joystick control corresponding to thetarget building, one touch and release operation to complete theconstruction of the target building at an aim point position of thefirst perspective, thereby implementing the fast and efficientconstruction of the target building in the virtual environment of theapplication; compared with related target building construction thatrequires three steps, the foregoing construction process reduces twosteps and improves the human-computer interaction efficiency.

According to the method for constructing a building in a virtualenvironment provided in this embodiment, the target constructionposition is further adjusted while the perspective is adjusted; theadjustment of the perspective and the adjustment of the targetconstruction position are combined into one step, thereby improving theoperation efficiency of the user, making the building construction moreflexible, and improving user experience.

An operation cancel button control is further superimposed and displayedon a second-perspective picture. In an intermediate process ofconstructing the building, the terminal can interrupt the constructionof the building. As shown in FIG. 9, step 405 to step 409 are replacedwith step 410 and step 411, to describe a method for canceling thebuilding construction by the terminal in the intermediate process ofconstructing the building. The method includes the following steps.

In step 410, a cancel operation triggered on an operation cancel buttoncontrol is received.

The terminal receives the cancel operation triggered on a screen areacorresponding to the operation cancel button control, for example, aclick operation triggered on the operation cancel button control.

In step 411, the first-perspective picture is redisplayed according tothe cancel operation.

The terminal cancels construction of the target building, and redisplaysthe first-perspective picture according to the cancel operation.

For example, as shown in FIG. 10, the terminal displays afirst-perspective picture 63, and receives a touch operation on abuilding joystick control 61. A target building 62 is displayed in thefirst-perspective picture 63. When the touch operation is draggeddownward, a first perspective is rotated to a second perspective. Theterminal displays a second-perspective picture 64, and the targetbuilding 62 is displayed in the second-perspective picture 64. Anoperation cancel button control “cancel construction” 66 can besuperimposed and displayed on the second-perspective picture 64. Theterminal receives a cancel operation triggered on the operation cancelbutton control “cancel construction” 66, cancels the construction of thetarget building, and redisplays the first-perspective picture 63.

In summary, according to the method for constructing a building in avirtual environment provided in this embodiment, building constructioncan be interrupted in an intermediate process of constructing thebuilding, and when a user performs a wrong operation, the operation canbe interrupted in time, thereby improving user experience.

FIG. 11 is a flowchart of a method for constructing an object, such as abuilding, in a virtual environment according to another exemplaryembodiment of this application. The method may further enable a terminalto continuously construct buildings and is applied to a terminal. Themethod includes the following steps.

In step 501, a first-perspective picture of an application is displayed.

For an exemplary description, refer to step 301. Details are notdescribed herein again.

In step 502, a touch operation triggered on a building joystick controlis received.

For an exemplary description, refer to step 302. Details are notdescribed herein again.

In step 503, a continuous construction button control is superimposedand displayed on the first-perspective picture.

The terminal superimposes and displays the continuous constructionbutton control on the first-perspective picture according to the touchoperation. The continuous construction button control is used forcontinuously and automatically constructing target buildings.

In step 504, a continuous construction operation triggered on thecontinuous construction button control is received.

The terminal receives the continuous construction operation triggered onthe continuous construction button control.

In step 505, starting from a current moment according to the continuousconstruction operation, a target building is automatically constructedonce at a target construction position every n seconds.

Starting from the triggering of the continuous construction operation,the terminal determines a moment after an interval of n seconds as afirst moment; a moment after an interval of n seconds from the firstmoment is determined as a second moment; a moment after an interval of nseconds from the second moment is determined as a third moment; and theremaining may be deduced by analogy. The terminal determines an i^(th)moment every n seconds, i being a positive integer. At the i^(th)moment, the terminal automatically constructs the target building onceat the target construction position.

Optionally, the terminal re-determines, within an interval of n seconds,the target construction position according to a drag operation inresponse to a drag of the touch operation; and automatically constructsthe target building once at the re-determined target constructionposition every n seconds.

There is an interval of n seconds between two consecutive moments atwhich the terminal constructs the target buildings. Within the intervalof n seconds, the user can drag the touch operation, and change, bydragging the touch operation, an observation direction in which aperspective of a virtual object in the virtual environment is located,thereby determining a new perspective picture, and determining a targetconstruction position in the new perspective picture. At the lattermoment of the two moments with the interval of n seconds, the terminalautomatically constructs the target building once at the re-determinedtarget construction position.

In step 506, a touch release operation corresponding to the touchoperation is received.

The terminal receives the touch release operation corresponding to thetouch operation.

In step 507, the construction of the target building is ended accordingto the touch release operation.

When the user maintains the touch operation, the terminal continuouslyconstructs the target buildings, and when the terminal receives thetouch release operation corresponding to the touch operation, theterminal ends the construction of the target buildings.

For example, as shown in FIG. 12, a first-perspective picture 50 isdisplayed on a terminal. When a touch operation is received on abuilding joystick control 51, a continuous construction button control55 is superimposed and displayed on the first-perspective picture 50,and a target building 52 is displayed in a first display manner. At afirst moment, the terminal displays a target building 54 displayed in asecond display manner corresponding to the target building 52. Theterminal receives a continuous construction operation of the continuousconstruction button control 55. In an interval between the first momentand a second moment, a user rotates, through the building joystickcontrol 51, a first observation direction in which a perspective islocated to a second observation direction. The terminal displays asecond-perspective picture 57, and the second-perspective picture 57displays a target building 56 displayed in the first display manner. Atthe second moment, the terminal displays, in the second-perspectivepicture 57, a target building 58 displayed in the second display mannercorresponding to the target building 56. The terminal receives a touchrelease operation corresponding to the touch operation, and ends theautomatic construction of the target buildings.

In summary, this embodiment provides a method for constructing abuilding in a virtual environment. A target construction position isadjusted while a perspective is adjusted; the adjustment of theperspective and the adjustment of the target construction position arecombined into one step, thereby improving the operation efficiency of auser, making the building construction more flexible, and improving userexperience.

Repeated steps for repeatedly constructing the same buildings areomitted through automatic and continuous building construction, therebyimproving the human-computer interaction.

In some embodiments, a user can customize the target buildingcorresponding to the building joystick control. FIG. 13 is a flowchartof a method for constructing an object, such as a building, in a virtualenvironment according to another exemplary embodiment of thisapplication. The method is applied to a terminal and includes thefollowing steps.

In step 601, a first-perspective picture of an application is displayed.

For an exemplary description, refer to step 301. Details are notdescribed herein again.

In step 602, an unfolding operation on a building menu unfolding controlis received.

The terminal receives the unfolding operation on the building menuunfolding control, and the unfolding operation is used for superimposingand displaying a building menu on a first-perspective picture.

In step 603, a building menu is displayed according to the unfoldingoperation.

The terminal superimposes and displays the building menu on thefirst-perspective picture according to the unfolding operation, and thebuilding menu includes at least one candidate building (or candidatebuilding object). Optionally, the candidate building includes at leastone of virtual stairs, a virtual wall, a virtual roof, and a virtualfloor.

In step 604, a selection operation is received for selecting onecandidate building from the at least one candidate building.

In step 605, the selected candidate building is determined as a targetbuilding.

The terminal determines the selected candidate building as the targetbuilding according to the selection operation.

For example, as shown in FIG. 14, a building joystick button control 61corresponding to a target building and a building menu unfolding control62 are superimposed and displayed on a first-perspective picture 60. Anicon of a candidate building 64 is correspondingly displayed on thebuilding joystick button control 61, that is, the candidate building 64is the target building in this case. An unfolding operation on thebuilding menu unfolding control 62 is received, a display box of thecandidate building is displayed, and a candidate building 63, thecandidate building 64, and a candidate building 65 are displayed in thedisplay box. A selection operation on a control corresponding to thecandidate building 63 is received, and the candidate building 63 isdetermined as the target building. In this case, an icon of thecandidate building 63 is correspondingly displayed on the buildingjoystick button control 61.

In summary, this embodiment provides a method for constructing abuilding in a virtual environment. A target building is customized and atype of a building that is constructed quickly is selected, which isapplicable to different application scenarios, thereby improving theoperation experience of a user.

FIG. 15 is a flowchart of a method for constructing an object, such as abuilding, in a virtual environment according to another exemplaryembodiment of this application. The method is applied to a terminal andincludes the following steps:

In step 701, a touch operation triggered on a building joystick buttoncontrol is received.

The terminal displays a first-perspective picture of an application, anda building joystick button control corresponding to a target building issuperimposed and displayed on the first-perspective picture. Theterminal receives the touch operation triggered on the building joystickbutton control.

In step 702, a shadow of a building at an aim point position of a firstperspective is displayed.

The terminal displays the shadow of the target building at the aim pointposition of the first perspective according to the touch operation.

In step 703, a determination is made as to whether to construct thebuilding.

The terminal determines whether to construct the target building.Optionally, when receiving a touch release operation corresponding tothe touch operation, the terminal determines to construct the targetbuilding, and performs step 704; otherwise, the terminal performs step707.

In step 704, a determination is made as to whether the building can beconstructed at a current position.

The terminal determines whether the target building can be constructedat the aim point position of the current first perspective. When thetarget building cannot be constructed at the aim point position of thefirst perspective in the virtual environment, step 706 is performed;otherwise, step 705 is performed. The aim point position of the firstperspective is an intersection of a direction in which the aim point islocated and an object in the virtual environment.

In step 705, the shadow of the building becomes a real object.

When the foregoing determination result is positive, the target buildingis transformed from the shadow to a real object in the virtualenvironment, and the construction of the target building is completed.

In step 706, feedback such as “the building cannot be constructed at thecurrent position” is provided.

When the target building cannot be constructed at the aim point positionof the first perspective in the virtual environment, the terminalprompts “the building cannot be constructed at the current position”.Optionally, the terminal superimposes and displays “the building cannotbe constructed at the current position” on the first-perspectivepicture.

In step 707, rotation of the building joystick button control continues.

The user continues to rotate the building joystick button control toadjust the perspective of the virtual object.

In step 708, a scene perspective is rotated, where the shadow of thebuilding changes with the aim point.

When the perspective of the virtual object changes, a scene in thevirtual environment changes, and a corresponding perspective picturechanges. The target building follows the change of the aim pointposition of the perspective picture. Optionally, the first-perspectivepicture displayed by the terminal is rotated to a second-perspectivepicture.

In step 709, a determination is made as to whether to construct thebuilding.

For an exemplary description, refer to step 703. Details are notdescribed herein again. When it is determined not to construct thebuilding, the terminal returns to step 708.

In step 710, a determination is made as to whether the building can beconstructed at a current position.

For an exemplary description, refer to step 704. Details are notdescribed herein again.

In step 711, the shadow of the building becomes a real object.

For an exemplary description, refer to step 705. Details are notdescribed herein again.

In step 712, feedback such as “the building cannot be constructed at thecurrent position” is provided.

For the detailed description, refer to step 706. Details are notdescribed herein again.

In summary, this embodiment provides a method for constructing abuilding in a virtual environment. A first-perspective picture of anapplication is displayed, and a building joystick control correspondingto a target building is superimposed and displayed on thefirst-perspective picture. A touch operation triggered on the buildingjoystick control is received. A target construction position of thetarget building is determined according to the touch operation. A touchrelease operation corresponding to the touch operation is received. Thetarget building is constructed at the target construction positionaccording to the touch release operation. In the foregoing targetbuilding construction process, a user completes, through the buildingjoystick control corresponding to the target building, one touch andrelease operation to complete the construction of the target building atan aim point position of the first perspective, thereby implementing thefast and efficient construction of the target building in the virtualenvironment of the application; compared with related target buildingconstruction that requires three steps, the foregoing constructionprocess reduces two steps and improves the human-computer interactionefficiency.

FIG. 16 is a block diagram of an apparatus for constructing an object,such as a building, in a virtual environment according to an exemplaryembodiment of this application. The apparatus may implement all or apart of a terminal by using software, hardware, or a combinationthereof. The apparatus can include a display module 801, a receivingmodule 802, a determining module 803, and a construction module 804. Oneor more modules of the apparatus can be implemented by processingcircuitry, software, or a combination thereof, for example

The display module 801 can be configured to display a first-perspectivepicture of an application, the first-perspective picture being a pictureof a virtual environment observed from a first perspective of a virtualobject in the virtual environment, a building joystick controlcorresponding to a target building being superimposed and displayed onthe first-perspective picture. The receiving module 802 can beconfigured to receive a touch operation triggered on the buildingjoystick control. The determining module 803 can be configured todetermine, based on the touch operation, a position at a target distancein a first observation direction in which the first perspective islocated as a target construction position of the target building. Thereceiving module 802 can be configured to receive a touch releaseoperation corresponding to the touch operation. Further, theconstruction module 804 can be configured to construct the targetbuilding at the target construction position according to the touchrelease operation.

In some embodiments, the display module 801 is configured to, after theposition at the target distance in the first observation direction inwhich the first perspective is located is determined as the targetconstruction position of the target building based on the touchoperation, display a virtual model of the target building in a firstdisplay manner at the target construction position; and after the targetbuilding is constructed at the target construction position according tothe touch release operation, display the virtual model of the targetbuilding in a second display manner at the target construction position.

In some embodiments, the display module 801 is configured to display thevirtual model of the target building in the first display manner at thetarget construction position in response to the fact that no objectaffecting the construction exists at the target construction position.

In some embodiments, the apparatus further includes a rotation module805. The rotation module 85 is configured to rotate, by using a virtualobject as a rotation center, the first observation direction to a secondobservation direction according to a drag distance in response to a dragof the touch operation. The display module 801 is configured to displaya second-perspective picture of the application, the second-perspectivepicture being a picture of the virtual environment observed from asecond perspective in the second observation direction in the virtualenvironment. The determining module 803 is configured to determine aposition at a target distance in the second observation direction as thetarget construction position of the target building.

In some embodiments, an operation cancel button control is superimposedand displayed on the second-perspective picture. The receiving module802 is configured to receive a cancel operation triggered on theoperation cancel button control. Further, the display module 801 isconfigured to redisplay the first-perspective picture according to thecancel operation.

In some embodiments, the display module 801 is configured to superimposeand display a continuous construction button control on thefirst-perspective picture. The receiving module 802 is configured toreceive a continuous construction operation triggered on the continuousconstruction button control. Further, the construction module 804 isconfigured to automatically construct, starting from a current momentaccording to the continuous construction operation, the target buildingonce at the target construction position every n seconds.

In some embodiments, the determining module 803 is configured tore-determine, within an interval of n seconds, the target constructionposition according to a drag operation in response to the drag of thetouch operation. Further, the construction module 804 is configured toautomatically construct the target building once at the re-determinedtarget construction position every n seconds.

In some embodiments, the receiving module 802 is configured to receive atouch release operation corresponding to the touch operation. Further,the construction module 804 is configured to end the construction of thetarget building according to the touch release operation.

In some embodiments, a building menu unfolding control is furthersuperimposed and displayed on the first-perspective picture. Thereceiving module 802 is configured to receive an unfolding operation onthe building menu unfolding control. The display module 801 isconfigured to display a building menu according to the unfoldingoperation, the building menu including at least one candidate building.The receiving module 802 is configured to receive a selection operationfor selecting one candidate building from the at least one candidatebuilding. Further, the determining module 803 is configured to determinethe selected candidate building as the target building.

In summary, this embodiment provides an apparatus for constructing abuilding in a virtual environment. A first-perspective picture of anapplication is displayed, and a building joystick control correspondingto a target building is superimposed and displayed on thefirst-perspective picture. A touch operation triggered on the buildingjoystick control is received. A target construction position of thetarget building is determined according to the touch operation. A touchrelease operation corresponding to the touch operation is received. Thetarget building is constructed at the target construction positionaccording to the touch release operation. In the foregoing targetbuilding construction process, a user completes, through the buildingjoystick control corresponding to the target building, one touch andrelease operation to complete the construction of the target building atan aim point position of the first perspective, thereby implementing thefast and efficient construction of the target building in the virtualenvironment of the application; compared with related target buildingconstruction that requires three steps, the foregoing constructionprocess reduces two steps and improves the human-computer interactionefficiency.

FIG. 17 is a structural block diagram of a terminal 900 according to anexemplary embodiment of this application. The terminal 900 may be asmartphone, a tablet computer, a Moving Picture Experts Group AudioLayer III (MP3) player, an MP4 player, a notebook computer, or a desktopcomputer. The terminal 900 may correspond to user equipment, a portableterminal, a laptop terminal, desktop terminal, or other device.

Generally, the terminal 900 includes processing circuitry, such as aprocessor 901, and a memory 902.

The processor 901 may include one or more processing cores such as a4-core processor or an 8-core processor. The processor 901 may beimplemented by using at least one hardware form of digital signalprocessing (DSP), a field-programmable gate array (FPGA), and aprogrammable logic array (PLA). The processor 901 may also include amain processor and a coprocessor. The main processor is a processorconfigured to process data in an awake state, and can also be referredto as a central processing unit (CPU). The coprocessor is a low powerconsumption processor configured to process data in a standby state. Insome embodiments, the processor 901 may be integrated with a graphicsprocessing unit (GPU). The GPU is configured to render and draw contentthat needs to be displayed on a display screen. In some embodiments, theprocessor 901 may further include an artificial intelligence (AI)processor. The AI processor is configured to process computingoperations related to machine learning.

The memory 902 may include one or more computer-readable storage media.The computer-readable storage medium may be non-transient ornon-transitory. The memory 902 may further include a high-speed randomaccess memory and a non-volatile memory, such as one or more magneticdisk storage devices or a flash storage device. In some embodiments, thenon-transitory computer-readable storage medium in the memory 902 isconfigured to store at least one instruction. The at least oneinstruction is executed by the processor 901 to perform the method forconstructing an object, such as a building, in a virtual environmentprovided in the method embodiments of this application.

In some embodiments, the terminal 900 may optionally include: aperipheral device interface 903 and at least one peripheral device. Theprocessor 901, the memory 902, and the peripheral device interface 903may be connected by using a bus or a signal cable. Each peripheraldevice may be connected to the peripheral device interface 903 by usinga bus, a signal cable, or a circuit board. Specifically, the peripheraldevice includes: at least one of a radio frequency (RF) circuit 904, atouch display screen 905, a camera 906, an audio circuit 907, apositioning component 908, and a power supply 909.

The peripheral device interface 903 may be configured to connect atleast one peripheral device related to input/output (I/O) to theprocessor 901 and the memory 902. In some embodiments, the processor901, the memory 902, and the peripheral device interface 903 areintegrated on the same chip or circuit board. In some other embodiments,any one or two of the processor 901, the memory 902, and the peripheraldevice interface 903 may be implemented on an independent chip orcircuit board. This is not limited in this embodiment.

The RF circuit 904 is configured to receive and transmit an RF signal,which is also referred to as an electromagnetic signal. The RF circuit904 communicates with a communication network and other communicationdevices through the electromagnetic signal. The RF circuit 904 convertsan electrical signal into an electromagnetic signal for transmission, orconverts a received electromagnetic signal into an electrical signal.Optionally, the RF circuit 904 includes: an antenna system, an RFtransceiver, one or more amplifiers, a tuner, an oscillator, a digitalsignal processor, a codec chip set, a subscriber identity module card,and the like. The RF circuit 904 may communicate with other terminals byusing at least one wireless communication protocol. The wirelesscommunication protocol includes, but is not limited to: a world wideweb, a metropolitan area network, an intranet, generations of mobilecommunication networks (2G, 3G, 4G, and 5G), a wireless local areanetwork and/or a WiFi network. In some embodiments, the radio frequencycircuit 904 may also include a circuit related to near fieldcommunication (NFC). This is not limited in this application.

The display screen 905 is configured to display a UI. The UI may includea graph, text, an icon, a video, and any combination thereof. When thedisplay screen 905 is a touch display screen, the display screen 905 isfurther capable of collecting a touch signal on or above a surface ofthe display screen 905. The touch signal may be inputted to theprocessor 901 as a control signal for processing. In this case, thedisplay screen 905 may be further configured to provide a virtual buttonand/or a virtual keyboard that are/is also referred to as a soft buttonand/or a soft keyboard. In some embodiments, there may be one displayscreen 905 disposed on a front panel of the terminal 900. In some otherembodiments, there may be at least two display screens 905 respectivelydisposed on different surfaces of the terminal 900 or designed in afoldable shape. In still some other embodiments, the display screen 905may be a flexible display screen, disposed on a curved surface or afolded surface of the terminal 900. Even, the display screen 905 may befurther set to have a non-rectangular irregular pattern, that is, aspecial-shaped screen. The display screen 905 may be made of materialssuch as a liquid crystal display (LCD), and an organic light-emittingdiode (OLED).

The camera component 906 is configured to collect images or videos.Optionally, the camera component 906 includes a front-facing camera anda rear-facing camera. Generally, the front-facing camera is disposed onthe front panel of the terminal, and the rear-facing camera is disposedon a back surface of the terminal. In some embodiments, there are atleast two rear-facing cameras, which are respectively any of a maincamera, a depth-of-field camera, a wide-angle camera, and a telephotocamera, to implement a background blurring function by fusing the maincamera with the depth-of-field camera, and implement panoramic shootingand virtual reality (VR) shooting functions or other fusing shootingfunctions by fusing the main camera with the wide-angle camera. In someembodiments, the camera component 906 may further include a flashlight.The flashlight may be a single-color-temperature flashlight or adouble-color-temperature flashlight. The double-color-temperatureflashlight is a combination of a warm flashlight and a cold flashlight,which may be used for light compensation at different colortemperatures.

The audio circuit 907 may include a microphone and a speaker. Themicrophone is configured to collect sound waves of users andsurroundings, and convert the sound waves into electrical signals andinput the signals to the processor 901 for processing, or input thesignals to the RF circuit 904 to implement voice communication. For thepurpose of stereo collection or noise reduction, there may be aplurality of microphones, respectively disposed at different portions ofthe terminal 900. The microphone may be further an array microphone oran omni-directional collection type microphone. The speaker isconfigured to convert electrical signals from the processor 901 or theRF circuit 904 into acoustic waves. The speaker may be a conventionalthin-film speaker or a piezoelectric ceramic speaker. When the speakeris the piezoelectric ceramic speaker, electric signals not only may beconverted into sound waves audible to human beings, but also may beconverted into sound waves inaudible to human beings for ranging andother purposes. In some embodiments, the audio circuit 907 may furtherinclude an earphone jack.

The positioning component 908 is configured to position a currentgeographic location of the terminal 900, to implement navigation or alocation based service (LBS). The positioning component 908 may be apositioning component based on the global positioning system (GPS) ofthe United States, the BeiDou system of China, or the Galileo system ofRussia.

The power supply 909 is configured to supply power to components in theterminal 900. The power supply 909 may be an alternating current, adirect current, a disposable battery, or a rechargeable battery. Whenthe power supply 909 includes the rechargeable battery, the rechargeablebattery may be a wired charging battery or a wireless charging battery.The wired charging battery is a battery charged through a wired line,and the wireless charging battery is a battery charged through awireless coil. The rechargeable battery may be further configured tosupport a quick charge technology.

In some embodiments, the terminal 900 further includes one or moresensors 910.

The one or more sensors 910 include, but are not limited to: anacceleration sensor 911, a gyroscope sensor 912, a pressure sensor 913,a fingerprint sensor 914, an optical sensor 915, and a proximity sensor916.

The acceleration sensor 911 may detect a magnitude of acceleration onthree coordinate axes of a coordinate system established by the terminal900. For example, the acceleration sensor 911 may be configured todetect components of gravity acceleration on the three coordinate axes.The processor 901 may control, according to a gravity accelerationsignal collected by the acceleration sensor 911, the touch displayscreen 905 to display the UI in a landscape view or a portrait view. Theacceleration sensor 911 may be further configured to collect motion dataof a game or a user.

The gyroscope sensor 912 may detect a body direction and a rotationangle of the terminal 900, and may work with the acceleration sensor 911to collect a 3D action performed by the user on the terminal 900. Theprocessor 901 may implement the following functions according to datacollected by the gyroscope sensor 912: motion sensing (for example, theUI is changed according to a tilt operation of the user), imagestabilization during shooting, game control, and inertial navigation.

The pressure sensor 913 may be disposed on a side frame of the terminal900 and/or a lower layer of the touch display screen 905. When thepressure sensor 913 is disposed on the side frame of the terminal 900, aholding signal of the user on the terminal 900 may be detected. Theprocessor 901 performs left and right hand recognition or a quickoperation according to the holding signal collected by the pressuresensor 913. When the pressure sensor 913 is disposed on the lower layerof the touch display screen 905, the processor 901 controls, accordingto a pressure operation of the user on the touch display screen 905, anoperable control on the UI. The operable control includes at least oneof a button control, a scroll-bar control, an icon control, and a menucontrol.

The fingerprint sensor 914 is configured to collect a fingerprint of theuser, and the processor 901 recognizes an identity of the user accordingto the fingerprint collected by the fingerprint sensor 914, or thefingerprint sensor 914 recognizes the identity of the user according tothe collected fingerprint. When the identity of the user is recognizedas credible, the processor 901 authorizes the user to perform a relatedsensitive operation. The sensitive operation includes unlocking ascreen, viewing encrypted information, downloading software, paying,changing a setting, and the like. The fingerprint sensor 914 may bedisposed on a front surface, a back surface, or a side surface of theterminal 900. When a physical button or a vendor logo is disposed on theterminal 900, the fingerprint 914 may be integrated with the physicalbutton or the vendor logo.

The optical sensor 915 is configured to collect ambient light intensity.In an embodiment, the processor 901 may control display luminance of thetouch display screen 905 according to the ambient light intensitycollected by the optical sensor 915. Specifically, when the ambientlight intensity is relatively high, the display luminance of the touchdisplay screen 905 is increased. When the ambient light intensity isrelatively low, the display luminance of the touch display screen 905 isreduced. In another embodiment, the processor 901 may furtherdynamically adjust a camera parameter of the camera component 906according to the ambient light intensity collected by the optical sensor915.

The proximity sensor 916, also referred to as a distance sensor, isgenerally disposed on the front panel of the terminal 900. The proximitysensor 916 is configured to collect a distance between the user and thefront surface of the terminal 900. In an embodiment, when the proximitysensor 916 detects that the distance between the user and the frontsurface of the terminal 900 gradually becomes smaller, the touch displayscreen 905 is controlled by the processor 901 to switch from a screen-onstate to a screen-off state. When the proximity sensor 916 detects thatthe distance between the user and the front surface of the terminal 900gradually becomes larger, the touch display screen 905 is controlled bythe processor 901 to switch from the screen-off state to the screen-onstate.

A person skilled in the art may understand that a structure shown inFIG. 17 is merely an example of the terminal 900, and the terminal mayinclude more or fewer components than those shown in the figure, orcombine some components, or use a different component deployment.

A person of ordinary skill in the art may understand that all or some ofthe steps of the methods in the embodiments may be implemented by aprogram instructing relevant hardware. The program may be stored in acomputer-readable storage medium. The computer-readable storage mediummay be the computer-readable storage medium included in the memory inthe foregoing embodiment, or may be a computer-readable storage mediumthat exists independently and that is not assembled in a terminal. Thecomputer-readable storage medium stores at least one instruction, atleast one program, a code set or an instruction set, and the at leastone instruction, the at least one program, the code set or theinstruction set is loaded and executed by the processor to implement themethod for constructing an object, such as a building, in a virtualenvironment according to any one of FIG. 3 to FIG. 15.

Optionally, the computer-readable storage medium may include: aread-only memory (ROM), a random access memory (RAM), a solid statedrive (SSD), an optical disc, or the like. The RAM may include aresistance random access memory (ReRAM) and a dynamic random accessmemory (DRAM). The sequence numbers of the foregoing embodiments of thisapplication are merely for description purpose, and are not intended toindicate priorities of the embodiments.

A person of ordinary skill in the art may understand that all or some ofthe steps in the embodiments may be implemented by hardware or a programinstructing relevant hardware. The program may be stored in acomputer-readable storage medium. The storage medium may be: a ROM, amagnetic disk, or an optical disc, or the like.

The foregoing descriptions are merely optional embodiments of thisapplication, but are not intended to limit this application. Anymodification, equivalent replacement, or improvement made within thespirit and principle of this application shall fall within theprotection scope of this application.

What is claimed is:
 1. A method for constructing a target object in avirtual environment of an application, the method comprising: displayinga first picture of the virtual environment according to a firstperspective corresponding to a first observation direction of a virtualmovable object in the virtual environment; displaying an objectconstruction controller corresponding to the target object; receiving atouch operation on the object construction controller; determining, byprocessing circuitry, a target construction position of the targetobject based on the touch operation, a target distance, and the firstobservation direction of the virtual movable object; receiving a touchrelease operation corresponding to the touch operation; and constructingthe target object at the determined target construction positionaccording to the touch release operation.
 2. The method according toclaim 1, further comprising: displaying a virtual model of the targetobject in a first display manner at the determined target constructionposition; and displaying the virtual model of the target object in asecond display manner at the determined target construction positionafter the target object is constructed.
 3. The method according to claim2, wherein the displaying the virtual model of the target object in thefirst display manner comprises: displaying the virtual model of thetarget object in the first display manner at the determined targetconstruction position based on a determination that no object affectingthe construction exists at the determined target construction position.4. The method according to claim 1, further comprising: rotating, byusing the virtual movable object as a rotation center, the firstobservation direction to a second observation direction according to adrag distance of the touch operation; and displaying a second picture ofthe application according to a second perspective corresponding to thesecond observation direction of the virtual movable object in thevirtual environment, wherein the determining the target constructionposition includes determining the target construction position at thetarget distance in the second observation direction.
 5. The methodaccording to claim 4, further comprising: displaying an operation cancelcontrol element on the second picture; receiving a user selection of theoperation cancel control element; and redisplaying the first pictureaccording to the user selection of the operation cancel control element.6. The method according to claim 1, further comprising: displaying acontinuous construction control element on the first picture after thetouch operation is received on the object construction controller;receiving a user selection of the continuous construction controlelement; and automatically constructing, starting from a current timeand according to the user selection of the continuous constructioncontrol element, the target object at the determined target constructionposition every n seconds.
 7. The method according to claim 6, whereinthe automatically constructing comprises: re-determining, within aninterval of the n seconds, the determined target construction positionaccording to a drag operation performed on the object constructioncontroller; and automatically constructing the target object at there-determined target construction position every n seconds.
 8. Themethod according to claim 7, further comprising: receiving the touchrelease operation corresponding to the touch operation while the targetobject is automatically constructed every n seconds; and ending theautomatic construction of the target object according to the touchrelease operation.
 9. The method according to claim 1, furthercomprising: displaying an object selection menu display element on thefirst picture; receiving a user selection of the object selection menudisplay element; displaying an object selection menu according to theuser selection of the object selection menu display element, the objectselection menu comprising at least one candidate object; and receiving aselection operation for selecting the target object from the at leastone candidate object.
 10. The method according claim 1, wherein theobject construction controller includes a joystick control element. 11.An apparatus for constructing a target object in a virtual environmentof an application, the apparatus comprising: processing circuitryconfigured to: display a first picture of the virtual environmentaccording to a first perspective corresponding to a first observationdirection of a virtual movable object in the virtual environment,display an object construction controller corresponding to the targetobject, receive a touch operation on the object construction controller,determine a target construction position of the target object based onthe touch operation, a target distance, and the first observationdirection of the virtual movable object, receive a touch releaseoperation corresponding to the touch operation, and construct the targetobject at the determined target construction position according to thetouch release operation.
 12. The apparatus according to claim 11,wherein the processing circuitry is configured to: display a virtualmodel of the target object in a first display manner at the determinedtarget construction position; and display the virtual model of thetarget object in a second display manner at the determined targetconstruction position after the target object is constructed.
 13. Theapparatus according to claim 12, wherein the processing circuitry isconfigured to: display the virtual model of the target object in thefirst display manner at the determined target construction positionbased on a determination that no object affecting the constructionexists at the determined target construction position.
 14. The apparatusaccording to claim 11, wherein the processing circuitry is configuredto: rotate, by using the virtual movable object as a rotation center,the first observation direction to a second observation directionaccording to a drag distance of the touch operation, display a secondpicture of the application according to a second perspectivecorresponding to the second observation direction of the virtual movableobject in the virtual environment, and determine the target constructionposition at the target distance in the second observation direction. 15.The apparatus according to claim 14, wherein the processing circuitry isconfigured to: display an operation cancel control element on the secondpicture; receive a user selection of the operation cancel controlelement; and redisplay the first picture according to the user selectionof the operation cancel control element.
 16. The apparatus according toclaim 11, wherein the processing circuitry is configured to: display acontinuous construction control element on the first picture after thetouch operation is received on the object construction controller,receive a user selection of the continuous construction control element,and automatically construct, starting from a current time and accordingto the user selection of the continuous construction control element,the target object at the determined target construction position every nseconds.
 17. The apparatus according to claim 16, wherein the processingcircuitry is configured to: re-determine, within an interval of the nseconds, the determined target construction position according to a dragoperation performed on the object construction controller; andautomatically construct the target object at the re-determined targetconstruction position every n seconds.
 18. The apparatus according toclaim 17, wherein the processing circuitry is configured to: receive thetouch release operation corresponding to the touch operation while thetarget object is automatically constructed every n seconds; and end theautomatic construction of the target object according to the touchrelease operation.
 19. The apparatus according to claim 11, wherein theprocessing circuitry is configured to: display an object selection menudisplay element on the first picture; receive a user selection of theobject selection menu display element; display an object selection menuaccording to the user selection of the object selection menu displayelement, the object selection menu comprising at least one candidateobject; and receiving a selection operation for selecting the targetobject from the at least one candidate object.
 20. A non-transitorycomputer-readable storage medium, storing instructions which whenexecuted by a processor cause the processor to perform a method forconstructing a target object in a virtual environment of an application,the method comprising: displaying a first picture of the virtualenvironment according to a first perspective corresponding to a firstobservation direction of a virtual movable object in the virtualenvironment; displaying an object construction controller correspondingto the target object; receiving a touch operation on the objectconstruction controller; determining a target construction position ofthe target object based on the touch operation, a target distance, andthe first observation direction of the virtual movable object; receivinga touch release operation corresponding to the touch operation; andconstructing the target object at the determined target constructionposition according to the touch release operation.